import React from 'react'
import { Swiper, SwiperSlide } from 'swiper/react';
import 'swiper/css';
import './Swiper.less'

import SwiperCore, { Autoplay } from 'swiper';
SwiperCore.use([Autoplay]);

export default () => {
  const images = [
    {
      url: 'https://gw.alicdn.com/bao/uploaded/i3/2766393417/O1CN01wTJT5l1b729rAuaoY_!!0-item_pic.jpg_270x270xzq90.jpg_.webp',
      href: 'https://uland.taobao.com/coupon/edetail?e=9hazd1L8INkNfLV8niU3R5TgU2jJNKOfc4SfXBF8mZqcRCCCdjsDI4ELXFo237CCYbg4KI%2BBvHt10TFqtUUDFa%2BUi8GL2tiVKneNC1Y5xv4sZsl6zb0VCrZB4GXhba7vDK%2FbSwsvbr6oNiQHGzjTk0q7L7RYBVu8%2ByRT%2Bfu9n97coTtNr1oy5E2jUoQN6E2wnh1xvuAzOvyj57ziW7mncQZABK20chGpiXv%2FwNKSIDWrgUiS0oEPDMnmEax92y1Jqnvkrv%2FI6vglM1ZJHcLCJg%3D%3D&&app_pvid=59590_33.5.74.149_853_1670756262823&ptl=floorId:13366;app_pvid:59590_33.5.74.149_853_1670756262823;tpp_pvid:4622f035-405b-4918-9d0c-e98dc67109d7&union_lens=lensId%3AMAPI%401670756262%4021054a95_0bf4_18500d56452_8bf2%4001'
    },
    {
      url: 'https://gw.alicdn.com/bao/uploaded/i3/759213442/O1CN014PbyI61bIU3lixQHX_!!0-item_pic.jpg_270x270xzq90.jpg_.webp',
      href: 'https://uland.taobao.com/coupon/edetail?e=QSg7QgXanF0NfLV8niU3R5TgU2jJNKOfc4SfXBF8mZp81ITEkuZQi3%2FaCDmeOl5yIpqQYaloh9naxIm1FpK6yzLzg%2Fgz0EtlSh5SJEUmyDHrk4fVZ9Sb3lR%2FZOIU55t7y5btVuVrT%2B7Uyx9NZHy6vo55RxK%2FL8diYXmoWdo7333oN5fa5xUqG8eNmWt3jWioK1cxzQ0cbUHelH0S%2Fb8o07pK%2BiB0fEdkrIiQYmSCRKdl2rpNOk5B10uwr3DmBMiQqnvkrv%2FI6vglM1ZJHcLCJg%3D%3D&&app_pvid=59590_33.5.74.149_853_1670756262823&ptl=floorId:13366;app_pvid:59590_33.5.74.149_853_1670756262823;tpp_pvid:4622f035-405b-4918-9d0c-e98dc67109d7&union_lens=lensId%3AMAPI%401670756262%4021054a95_0bf4_18500d56452_8bf3%4001'
    },
    {
      url: 'https://gw.alicdn.com/bao/uploaded/i2/389048191/O1CN01tXre562ANWySE0o5w_!!0-item_pic.jpg_270x270xzq90.jpg_.webp',
      href: 'https://uland.taobao.com/coupon/edetail?e=6VPzMOt5CQYNfLV8niU3R5TgU2jJNKOfc4SfXBF8mZpD9FSKWsVXpfMzeL8%2B%2FiJba%2B35Jx9Umo6O4zQRKhJ94AP1n%2F8KbLxvWLuc0RRQI50sZsl6zb0VCrZB4GXhba7veLkRdv4WX6LEvM5NUqMo9Uq7L7RYBVu8%2ByRT%2Bfu9n97coTtNr1oy5E2jUoQN6E2wnh1xvuAzOvyj57ziW7mncQT50BvUmg46NjbVfUheIlT%2BuksjUngNSzpK0trSpfIOqnvkrv%2FI6vglM1ZJHcLCJg%3D%3D&&app_pvid=59590_33.5.74.149_853_1670756262823&ptl=floorId:13366;app_pvid:59590_33.5.74.149_853_1670756262823;tpp_pvid:4622f035-405b-4918-9d0c-e98dc67109d7&union_lens=lensId%3AMAPI%401670756262%4021054a95_0bf4_18500d56452_8bf5%4001'
    },
    {
      url: 'https://gw.alicdn.com/bao/uploaded/i1/2202552815377/O1CN016nXVIH1paiQqPwe4p_!!0-item_pic.jpg_270x270xzq90.jpg_.webp',
      href: 'https://uland.taobao.com/coupon/edetail?e=nuzWwqT6Jz4NfLV8niU3R5TgU2jJNKOfc4SfXBF8mZqL7BKnWt40yP%2BBDejapHPDWds9NtRGwkUaq7%2BRreXsCG7CcCqMg17n6Ak%2BpEilyeksZsl6zb0VCrZB4GXhba7v5HMqf8ClrNGIsu03y8o5ZEq7L7RYBVu8%2ByRT%2Bfu9n97coTtNr1oy5E2jUoQN6E2wnh1xvuAzOvyj57ziW7mncQZABK20chGpYG5yVXuIb0ZXqBOUObm6kk0%2FpIhQ6YTfrk5oEZwv0ZJMDQVG07AK7A%3D%3D&&app_pvid=59590_33.5.74.149_853_1670756262823&ptl=floorId:13366;app_pvid:59590_33.5.74.149_853_1670756262823;tpp_pvid:4622f035-405b-4918-9d0c-e98dc67109d7&union_lens=lensId%3AMAPI%401670756262%4021054a95_0bf4_18500d56452_8bf6%4001'
    },
  ]
  return (
    <div className='swiper'>
      <Swiper
        modules={[Autoplay]}
        spaceBetween={0}
        slidesPerView={1}
        autoplay={{
          delay: 1000,
          disableOnInteraction: false
        }}
      >
        {images.map((item, i) => (
          <SwiperSlide key={i}>
            <a href={item.href} target='_blank'>
              <img className='item' src={item.url} alt="" />
            </a>
          </SwiperSlide>
        ))}
      </Swiper>
    </div>
  );
};